@extends('/model/index')
@section('title','商城首页')
@section('content')

<!--Begin Menu Begin-->

<div class="i_bg bg_color">
	<div class="i_ban_bg">
		<!--Begin Banner Begin-->
    	<div class="banner">    	
            <div class="top_slide_wrap">
                <ul class="slide_box bxslider" id="uls-lunbo">
                    <li><img src="/images/ban1.jpg" width="740" height="401" /></li> 
                    <!-- <li><img src="/images/ban3.jpg" width="740" height="401" /></li>
                    <li><img src="/images/ban4.jpg" width="740" height="401" /></li> 
                    <li><img src="/images/ban5.jpg" width="740" height="401" /></li> 
                    <li><img src="/images/ban1.jpg" width="740" height="401" /></li>  -->
                </ul>
                
                <div class="op_btns clearfix">
                    <a href="#" class="op_btn op_prev"><span></span></a>
                    <a href="#" class="op_btn op_next"><span></span></a>
                </div>
                <!-- 商城首页轮播图 -->
                <script type="text/javascript">
                    
                    var i = 0;
                    $('div .clearfix').find('a').first().click(function()
                    {
                        i++;
                        // $('#uls-lunbo').find('li').first().hide().prependTo('#uls-lunbo').show();

                        $("#uls-lunbo").find('li img').attr('src','/images/ban'+i+'.jpg');
                        if(i >= 5) {
                            i = 0;
                        }
                        return false;
                    });

                    var j = 6;
                    $('div .clearfix').find('a').last().click(function()
                    {
                        // alert('下一张');
                        j--;
                        $("#uls-lunbo").find('li img').attr('src','/images/ban'+j+'.jpg');
                        if(j <= 1) {
                            j = 6;
                        }
                        return false;
                    });

                </script>        
            </div>
        </div>
        <script type="text/javascript">

            
            // $('div .clearfix').find('a').eq(0).click(function(){
            //     alert('a');
            //     return false;
            // })

        </script>
        <!--End Banner End-->
        <div class="inews">
            <div class="news_t">
                <span class="fr"><a href="#">更多 ></a></span>新闻资讯
            </div>
            <ul>
            @foreach($news as $k => $v)
                <li><span>[ {{$v['type']}} ]</span><a href="/news?id={{$v['id']}}">{{$v['title']}}</a></li>
            @endforeach
                
            </ul>
            <div class="charge_t">
                话费充值<div class="ch_t_icon"></div>
            </div>
            <form>
            <table border="0" style="width:205px; margin-top:10px;" cellspacing="0" cellpadding="0">
              <tr height="35">
                <td width="33">号码</td>
                <td><input type="text" value="" class="c_ipt" /></td>
              </tr>
              <tr height="35">
                <td>面值</td>
                <td>
                    <select class="jj" name="city">
                      <option value="0" selected="selected">100元</option>
                      <option value="1">50元</option>
                      <option value="2">30元</option>
                      <option value="3">20元</option>
                      <option value="4">10元</option>
                    </select>
                    <span style="color:#ff4e00; font-size:14px;">￥99.5</span>
                </td>
              </tr>
              <tr height="35">
                <td colspan="2"><input type="submit" value="立即充值" class="c_btn" /></td>
              </tr>
            </table>
            </form>
        </div>
    </div>

    </div>
    <!--Begin 热门商品 Begin-->
    <div class="content mar_10">
    	<div class="h_l_img">
        	<div class="img"><img src="/images/1.jpg" width="188" height="188" /></div>
            <div class="pri_bg">
                <span class="price fl">大家都在看!!</span>
                <span class="fr"></span>
            </div>
        </div>
        <div class="hot_pro">        	
        	<div id="featureContainer">
                <div id="feature">
                    <div id="block">
                        <div id="botton-scroll">
                            <ul class="featureUL" id="uls-hotgoods">
                            <!-- 热门商品信息展示模块 -->
                            </ul>
                        </div>
                    </div>
                    <a class="h_prev" href="">Previous</a>
                    <a class="h_next" href="">Next</a>

    <script type="text/javascript">
    //点击获取下一张热门商品
        $('.h_prev').click(function()
        {
            $("#uls-hotgoods").find('li').first().hide().appendTo("#uls-hotgoods").show();
            return false;
        });

    //点击获取上一张热门商品
        $('.h_next').click(function()
        {
            // alert('a');
            $("#uls-hotgoods").find('li').last().hide().prependTo("#uls-hotgoods").show();
            return false;
        })

    </script>

                </div>
            </div>
        </div>
    </div>
    <!--Begin 限时特卖 Begin-->
    <div class="i_t mar_10">
    	<span class="fl">限时特卖</span>
        <span class="i_mores fr"><a href="/sellgoods">更多</a></span>
    </div>
    <div class="content">
    	<div class="i_sell">
            <div id="imgPlay">
                <ul class="imgs" id="actor">
                     <!-- 限时特卖轮播 --> 
                </ul>
                <div class="previ">上一张</div>
                <div class="nexti">下一张</div>
            </div>        
        </div>
        <!-- 限时特卖商品轮播 -->
        <script type="text/javascript">
            $(function()
            {
                $.get('/timergoods',function(data)
                {
                    var str = '';
                    if(data != 0) {
                        for (var i = 0; i < data.length; i++) {
                            str += '<li><a href="/sellDetails?id='+data[i].id+'"><img src="'+data[i].picname+'" width="211" height="357" /></a></li>';
                        };
                    }
                    $("#actor").html(str);
                },'json');


                setInterval(function()
                {
                    $("#actor").find('li').first().hide().appendTo('#actor').slideDown(1000);
                },3000);
                

                //点击上一张特卖
                $("div .previ").click(function()
                {
                    $("#actor").find('li').first().hide().appendTo('#actor').show();
                    return false;
                })

                //点击下一张
                $("div .nexti").click(function()
                {
                    $("#actor").find('li').last().hide().prependTo('#actor').show();
                    return false;
                })
            });

        </script>
        <div class="sell_right">
        	<div class="sell_1">
            	<div class="s_img"><a href="/sellDetails?id={{$timer[0]['id']}}"><img src="{{$timer[0]['picname']}}" width="185" height="155" /></a></div>
            	<div class="s_price">￥<span>{{$timer[0]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[0]['id']}}">{{$timer[0]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
            <div class="sell_2">
            	<div class="s_img"><a href="/sellDetails?id={{$timer[1]['id']}}"><img src="{{$timer[1]['picname']}}" width="185" height="155" /></a></div>
            	<div class="s_price">￥<span>{{$timer[1]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[1]['id']}}">{{$timer[1]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
            <div class="sell_b1">
            	<div class="sb_img"><a href="/sellDetails?id={{$timer[2]['id']}}"><img src="{{$timer[2]['picname']}}" width="242" height="356" /></a></div>
            	<div class="s_price">￥<span>{{$timer[2]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[2]['id']}}">{{$timer[2]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
            <div class="sell_3">
            	<div class="s_img"><a href="/sellDetails?id={{$timer[3]['id']}}"><img src="{{$timer[3]['picname']}}" width="185" height="155" /></a></div>
            	<div class="s_price">￥<span>{{$timer[3]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[3]['id']}}">{{$timer[3]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
            <div class="sell_4">
            	<div class="s_img"><a href="/sellDetails?id={{$timer[4]['id']}}"><img src="{{$timer[4]['picname']}}" width="185" height="155" /></a></div>
            	<div class="s_price">￥<span>{{$timer[4]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[4]['id']}}">{{$timer[4]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
            <div class="sell_b2">
            	<div class="sb_img"><a href="/sellDetails?id={{$timer[5]['id']}}"><img src="{{$timer[5]['picname']}}" width="242" height="356" /></a></div>
            	<div class="s_price">￥<span>{{$timer[5]['price']}}</span></div>
                <div class="s_name">
                	<h2><a href="/sellDetails?id={{$timer[5]['id']}}">{{$timer[5]['goods']}}</a></h2>
                    倒计时：<span name='hours'></span> 时 <span name='minutes'></span> 分 <span name='seconds'></span> 秒
                </div>
            </div>
        </div>
    </div>

    <!-- 限时特卖倒计时 -->
    <script type="text/javascript">

        setInterval(function(){

            var d = '2016-12-5 23:59:59';
            var endtime = new Date(d);
            var nowtime = new Date();
            var leftsecond = parseInt((endtime.getTime()-nowtime.getTime())/1000);
            d = parseInt(leftsecond/3600/24);
            h = parseInt((leftsecond/3600)%24);
            m = parseInt((leftsecond/60)%60);
            s = parseInt(leftsecond%60);
            var td = d*24+h;
            $('span[name=hours]').html(td);
            $('span[name=minutes]').html(m);
            $('span[name=seconds]').html(s);
        },1000);


    </script>
    <!--End 限时特卖 End-->
    <div class="content mar_20">
    	<img src="/images/mban_1.jpg" width="1200" height="110" />
    </div>
	<!--Begin 进口 生鲜 Begin-->
    <div class="i_t mar_10">
    	<span class="floor_num">1F</span>
    	<span class="fl">进口 <b>·</b> 生鲜</span>                
        <span class="i_mores fr"><a href="#">进口咖啡</a>&nbsp; &nbsp; &nbsp; <a href="#">进口酒</a>&nbsp; &nbsp; &nbsp; <a href="#">进口母婴</a>&nbsp; &nbsp; &nbsp; <a href="#">新鲜蔬菜</a>&nbsp; &nbsp; &nbsp; <a href="#">新鲜水果</a></span>
    </div>
    <div class="content">
    	<div class="fresh_left">
        	<div class="fre_ban">
            	<div id="imgPlay1">
                    <ul class="imgs" id="actor1">
                        <li><a href="#"><img src="/images/fre_r.jpg" width="211" height="286" /></a></li>
                        <li><a href="#"><img src="/images/fre_r.jpg" width="211" height="286" /></a></li>
                        <li><a href="#"><img src="/images/fre_r.jpg" width="211" height="286" /></a></li>
                    </ul>
                    <div class="prevf">上一张</div>
                    <div class="nextf">下一张</div> 
                </div>   
            </div>
            <div class="fresh_txt">
            	<div class="fresh_txt_c">
                	<a href="#">进口水果</a><a href="#">奇异果</a><a href="#">西柚</a><a href="#">海鲜水产</a><a href="#">品质牛肉</a><a href="#">奶粉</a><a href="#">鲜活禽蛋</a><a href="#">进口酒</a><a href="#">进口奶粉</a><a href="#">鲜活禽蛋</a>
                </div>
            </div>
        </div>
        <div class="fresh_mid">
        	<ul>
            	<li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_1.jpg" width="185" height="155" /></a></div>
                </li>
                <li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_2.jpg" width="185" height="155" /></a></div>
                </li>
                <li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_3.jpg" width="185" height="155" /></a></div>
                </li>
                <li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_4.jpg" width="185" height="155" /></a></div>
                </li>
                <li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_5.jpg" width="185" height="155" /></a></div>
                </li>
                <li>
                	<div class="name"><a href="#">新鲜美味  进口美食</a></div>
                    <div class="price">
                    	<font>￥<span>198.00</span></font> &nbsp; 26R
                    </div>
                    <div class="img"><a href="#"><img src="/images/fre_6.jpg" width="185" height="155" /></a></div>
                </li>
            </ul>
        </div>
        <div class="fresh_right">
        	<ul>
            	<li><a href="#"><img src="/images/fre_b1.jpg" width="260" height="220" /></a></li>
                <li><a href="#"><img src="/images/fre_b2.jpg" width="260" height="220" /></a></li>
            </ul>
        </div>
    </div>    
    <!--End 进口 生鲜 End-->
    <!--Begin 食品饮料 Begin-->
     
    <!--End 食品饮料 End-->
    <!--Begin 个人美妆 Begin-->
     
    <!--End 个人美妆 End-->
  
    <!--Begin 母婴玩具 Begin-->
    
    <!--End 母婴玩具 End-->
    <!--Begin 家居生活 Begin-->
    
    <!--End 家居生活 End-->
    <!--Begin 数码家电 Begin-->
     
    <!--End 数码家电 End-->
    <!--Begin 猜你喜欢 Begin-->
    <div class="i_t mar_10">
    	<span class="fl">猜你喜欢</span>
    </div>    
    <div class="like">        	
        <div id="featureContainer1">
            <div id="feature1">
                <div id="block1">
                    <div id="botton-scroll1">
                        <ul class="featureUL" name='featureul'>

                           

                        </ul>
                    </div>
                </div>
                <a class="l_prev" name='l_prev'>Previous</a>
                <a class="l_next" name='l_next'>Next</a>
            </div>
        </div>
    </div>

    <!-- 热卖商品  猜你喜欢 模块 -->
    <script type="text/javascript">
        $.get('feature',function(data)
        {
            var str = '';
            for (var i = 0; i < data.length; i++) {
                str += '<li class="featureBox"><div class="box"><div class="imgbg"><a href="/product?id='+data[i].id+'"><img src="'+data[i].picname+'" width="160" height="136" /></a></div><div class="name"><a href="/product?id='+data[i].id+'"><h2>'+data[i].goods+'</a></div><div class="price"><font>￥<span>'+data[i].price+'</span></font> &nbsp;</div></div></li>';
            };
            $("ul[name=featureul]").html(str);
        },'json');

        $("a[name=l_prev]").click(function()
        {
            $("ul[name=featureul]").find('li').first().appendTo($('ul[name=featureul]'));
            return false;
        });

        $("a[name=l_next]").click(function()
        {
            $("ul[name=featureul]").find('li').last().show().prependTo($("ul[name=featureul]"));
            return false;
        });
    </script>
@endsection
